/*******************************************************************
 *
 * Copyright (C), 2021-2022, Letstrong, All rights reserved.
 *
 * Author      : 
 * Create Time : 2020-12-14
 * Version     : v0.1
 * Description : 
 *******************************************************************/

#ifndef __HAL_UTC_H__
#define __HAL_UTC_H__

#include "stdint.h"

#ifdef __cplusplus
extern "C" {
#endif  /* __cplusplus */


// To be used with
typedef struct
{
  uint8_t seconds;  // 0-59
  uint8_t minutes;  // 0-59
  uint8_t hour;     // 0-23
  uint8_t day;      // 0-30
  uint8_t month;    // 0-11
  uint16_t year;    // 2000+
} hal_rtc_t;


void hal_utc_update(void);
void hal_utc_seconds_set(uint32_t newTime);
uint32_t hal_utc_seconds_get(void);
void utc_set_clock(uint32_t newTime);
uint32_t utc_get_clock(void);

#ifdef __cplusplus
}
#endif  /* __cplusplus */


#endif      /* __HAL_UTC_H__ */

